package com.cx.controller;

import com.cx.dto.room;
import com.cx.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/room")
public class RoomController {
    @Autowired
    RoomService roomService;
    @ResponseBody
    @RequestMapping("/roominfo")
    public List<Object> roomInfo(String hotelName){
        System.out.println(hotelName);
        List<Object> roomInfo = new ArrayList<>();
        List<room> hotelInfos = roomService.findRoomInfoBYHotelName(hotelName);
        roomInfo.add(hotelInfos);
        return roomInfo;
    }

}
